<?php
require_once('Zend/View/Helper/Abstract.php');

class Kbs_View_Helper_Gradient extends Zend_View_Helper_Abstract
{
    const REPEAT_Y = 0;
    const REPEAT_X = 1;

    public function gradient($id, $beginColor, $endColor, $mode = self::REPEAT_Y)
    {
        $this->view->inlineScript()->prependScript("setGradient('$id', '$beginColor', '$endColor', $mode);");
    }
}